<template>
  <div>
    <van-nav-bar
      title="我的订单"
      left-arrow
      @click-left="onClickLeft"
    >
      <van-icon name="search" slot="right" />
    </van-nav-bar>

    <van-tabbar v-model="active" :fixed="false">
      <van-tabbar-item icon="shop">全部</van-tabbar-item>
      <van-tabbar-item icon="balance-list-o">待付款</van-tabbar-item>
      <van-tabbar-item icon="logistics">待发货</van-tabbar-item>
      <van-tabbar-item icon="exchange">待收货</van-tabbar-item>
      <van-tabbar-item icon="records">待评价</van-tabbar-item>
    </van-tabbar>

    <van-cell v-for="item in list" value="内容" size="large" >
      <div>
        <div slot='title'>
          <h4>订单号:{{item._id}}</h4>
          <p>总价:{{item.price}}</p>
        </div>
        <div slot='label'>
          <h3>收货人:{{item.receiver}}</h3>
          <p>收货地址:{{item.address}}</p>
        </div>
      </div>
    </van-cell>

  </div>
</template>

<script>
  import * as api from '@/api/getProList';
  export default {
    name:'MyBuy',
    data(){
      return {
        active:0,
        list:[]
      }
    },
    methods:{
      onClickLeft(){
        this.$router.back(-1)
      }
    },
    mounted(){
      // 查询订单信息
      api.getProCate({}).then(res=>{
        if(res.status == 200){
          this.list = res.data.orders;
        }else{
        }
      });
    }
  }
</script>

<style>
</style>
